/*
 * @(#)ServiceExecutor.java $version 2010. 8. 11
 *
 * Copyright 2007-2010 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nhncorp.usf.core.service;

import java.util.Map;

import com.nhncorp.usf.core.config.runtime.Action;
import com.nhncorp.usf.core.exception.ExceptionHandler;
import com.nhncorp.usf.core.invoker.Invoker;

/**
 * Interface to execute all business defined in {@link Action}.
 *
 * @author Web Platform Development Team.
 */
public interface ServiceExecutor {
    /**
     * status of executed methods
     */
    public enum RESULT_STATUS {
        success, failure
    }

    /**
     * set invoker to execute method of business object.
     *
     * @param invoker Invoker
     */
    void setInvoker(Invoker invoker);

    /**
     * set invoker to execute method of business object.
     *
     * @param exceptionHandler ExceptionHandler
     */
    void setExceptionHandler(ExceptionHandler exceptionHandler);

    /**
     * execute all business defined in {@link Action}.
     *
     * @param actionInfo     {@link Action}
     * @param requestDataMap used parameters for executing methods of action
     * @return RESULT_STATUS
     * @throws Exception the Exception
     */
    RESULT_STATUS execute(Action actionInfo, Map<String, Object> requestDataMap) throws Exception;
}